package com.xinqi.modules.databank.v2.convert;


import com.xinqi.common.mapstruct.CommonConvertConfig;
import com.xinqi.modules.databank.v1.domain.CourseInteractionSubmitEntity;
import com.xinqi.modules.databank.dto.req.question.ResourceAnswerDTO;
import com.xinqi.modules.databank.dto.rsp.CourseInteractionSubmitResult;
import com.xinqi.modules.databank.dto.rsp.ResourceInteractionLogResultDTO;
import com.xinqi.modules.databank.dto.rsp.StudentScoreResultDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * 课程资料库主表转换
 *
 * @author: system
 * @date: 2023/03/14
 */
@Mapper(config = CommonConvertConfig.class)
public abstract class CourseResourceAnswerConvert {

    public abstract List<StudentScoreResultDTO> convert(List<ResourceInteractionLogResultDTO> list);

    @Mapping(source = "userId", target = "studentId")
    public abstract ResourceAnswerDTO convertBaseAnswer(CourseInteractionSubmitEntity submit);

    public abstract List<ResourceAnswerDTO> convertBaseAnswerList(List<CourseInteractionSubmitEntity> list);

    public abstract List<ResourceAnswerDTO> convertSubmitResult(List<CourseInteractionSubmitResult> list);

}
